Added new Tennis Plugin to project #1139
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
In this Pull Request, I added a new Tennis Plugin to the project. This add-on allows users to access current ATP and WTA rankings, as well as past Grand Slam titles.
Change details:
In jarviscli/plugins/tennis.py
Added TennisDataFetcher class:
This class is responsible for obtaining tennis-related data from different data sources.
The fetch_rankings method is provided to get the current ATP or WTA rankings.
The fetch_grand_slam_winners method is provided to retrieve past Grand Slam winners.
Added TennisPlugin class:
This class is a plug-in that allows users to select the tennis-related data they want to obtain.
Users can choose to get the current ATP or WTA rankings, or they can choose to get past Grand Slam titles.
Code optimization and improvements:
Optimized the structure of the code to make it clearer and easier to maintain.
Added error handling to the fetch_grand_slam_winners method to ensure error conditions are handled correctly when fetching data.
Instructions:
Users can launch the plugin by entering the tennis command through Jarvis, and then follow the prompts to select the type of data they want to obtain.
Example:
After the user enters the corresponding numerical selection, the plugin displays the corresponding tennis data.
Conclusion:
This new Tennis Plugin adds valuable functionality to the project, allowing users to easily obtain tennis-related data. Hopefully this improvement will be merged into the master branch.